The present invention relates generally to motion control systems, and, more particularly, to a method and apparatus for determining motor velocity using edge mode hysteresis with a finite impulse response filter.
Rotating motors are typically controlled by a motor drive that receives a desired motor velocity signal and, based on the motor velocity signal, produces and outputs a torque signal that is applied to the motor. Adjustment of the torque signal based on changes to the desired motor velocity signal relative to the actual motor velocity ensures that the motor rotates at the desired velocity.
Conventional drive systems include an optical motor encoder that detects and counts the passage of optical markings present on a disk that rotates along with the rotating load during operation. The output from the encoder can be analyzed to determine motor position and velocity. Typical encoders employ a two channel system that outputs pulse trains corresponding to detections of the optical markings. Phase differences between the pulse trains from each channel may be used to determine motor direction. An edge detection circuit receives both pulse trains and generates a edge signal which includes a peak for every rising and falling edge of the pulse train for each channel. Hence, four successive peaks would represent a rising edge of the A channel, a rising edge of the B channel, a falling edge of the A channel, and a falling edge of the B channel.
An accumulator circuit receives the edge signal and tracks the position of the motor using a counter that is incremented for each edge while the motor is moving in one direction and decremented for each edge while the motor is moved in the opposite direction. The counter is periodically sampled to calculate a velocity measurement for the motor, which is fed back to the motor drive to adjust the torque signal applied to the motor to thereby control the velocity of the motor.
FIG. 1 illustrates an exemplary edge signal 10 useful for determining motor position and velocity. The edge signal includes a plurality of edges 12 representing rising and falling edges of the signal generated by the encoder. The accumulator is sampled at the frequency indicated by sampling interval 14. The edge-to-edge time (i.e., the time between four edges or the time between subsequent rising edges of the A channel signal) is represented by the edge-to-edge interval 16. Note that the accumulator is sampled in the time period between edges. An edge timer, which is reset with the receipt of every edge, may be used to track the time elapsed since the last edge so that the edge signal may be aligned to the last edge for accurate velocity determination. Thus, the counter and edge timer may be sampled concurrently to accurately determine the number of edges that occurred during the current sampling interval as well as the precise time at which the edges occurred.
The edge detection velocity technique is effective at higher motor velocities in which several encoder edges occur during each sampling interval. For slower velocities, the edge technique introduces excessive phase shift, and at some point, the time of the last encoder edge can no longer be measured. The edge timer may overflow between edges, thereby reducing the accuracy of the last edge time. Hence, the edge-to-edge time method is disabled and a fixed sample interval (dx/dt) velocity calculation is employed, where the number of pulses between sampling intervals is divided by the sample interval to calculate the velocity. Typically, a hysteresis technique is used where the edge-to-edge technique is disabled when the calculated velocity drops to zero (e.g., no edges detected during a sampling interval). The dx/dt technique is employed until the edge count exceeds a predetermined threshold (e.g., four edges per sampling interval).
FIG. 2 illustrates a curve generated for a dx/dt time technique, where the motor velocity is determined by dividing the number of edges counted during a sampling interval by the sampling interval. For purposes of illustration, the motor velocity is kept below a point at which an edge-to-edge algorithm would be enacted (e.g., four edges per sampling interval). In the example of FIG. 2, the motor velocity is varied sinusoidally between +35 rpm and −35 rpm at a frequency of 1 second. The sample interval for the velocity algorithm is 500 usec.
FIG. 2 shows plot of a velocity feedback signal 20 from the dx/dt velocity calculation algorithm and a baseline signal 22 generated from the feedback signal 20. The baseline signal 22 represents the actual velocity of the motor 32. The phase shift between the feedback signal 20 and the baseline signal 22 results from the low pass filtering technique employed to generate the exemplary curve for illustrating the baseline signal 22.
Employing the dx/dt technique illustrated in FIG. 2, results in a feedback velocity signal with significant jitter. The determined velocity falls within a discrete velocity band depending on the number of edges that occurred during a sampling interval. The discrete bands in the velocity feedback signal 20 indicate where 1, 2, or 3 edges are detected per sampling interval.
High performance drives encounter a ‘noise limit’ in the velocity feedback determination that restricts the maximum achievable bandwidth. This problem becomes worse as sample times are reduced (e.g., below one millisecond).
Therefore, there is a need for a technique to measure motor velocity at times of low velocity operation that reduces the level of jitter in the feedback signal. The present invention is directed to overcoming, or at least reducing the effects of, one or more of the problems set forth above.
This section of this document is intended to introduce various aspects of art that may be related to various aspects of the present invention described and/or claimed below. This section provides background information to facilitate a better understanding of the various aspects of the present invention. It should be understood that the statements in this section of this document are to be read in this light, and not as admissions of prior art.